package net.oschina.archx.spring.utils;

import org.springframework.core.io.support.PropertiesLoaderSupport;

import java.io.IOException;
import java.util.Properties;

/**
 * PropertiesConfigurer
 *
 * @author Archx[archx@foxmail.com]
 * @date 2016/3/11 0011
 */
public class PropertiesConfigurer extends PropertiesLoaderSupport {

    private static Properties properties;

    private String my;
    public static String getValue(String key) {
        if (properties == null) return null;
        return properties.getProperty(key);
    }

    /**
     * 初始化方法
     *
     * @throws IOException
     */
    public void init() throws IOException {
        PropertiesConfigurer.properties = mergeProperties();
    }

    public void setMy(String my) {
        this.my = my;
        System.out.println(my);
    }
}
